www.gusucode.com > 落叶冰点万能企业网站内容管理系统 V9.1 > 落叶冰点万能企业网站内容管理系统 V9.1\code\admin\adminLabel\D_chk2_add_custom_content_loop_lable.asp

    <%


'**************************************************************
' 新动软网站管理系统
' 官方网站: http://www.aspcpu.com
' 系统作者: 阮丁远(网名:天下程序)
' Copyright 新动软网站管理系统 版权所有
'**************************************************************


%>



<html>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />



<LINK href="../css.css" type=text/css rel=stylesheet>
<%

dir_set="../../"


%>


<!--#include file=../../inc/conn.asp-->
<!--#include file=../../inc/Functionb.asp-->

<!--#include file=../../inc/ajaxLIB.asp-->

<!--#include file=../inc/checkadmin2.asp-->

<!--#include file=../../inc/functionFiless.asp-->


<!--#include file=../../inc/ND_class_function.asp-->



<%
AJAXshowLoader()

%>

<%


if find_dataw("qitashezhi123","0",7)<>"1" and qx_if_max=0 then
response.redirect "../D_suodinguser.asp"
end if

%>


<%

session("newdsoft_selct_a_lable_bef_haved")=""

set filea=new Cls_FSO

fpath=request("fpath")
bname=trim(request("bnm"))

bname3=bname&".asp"

cont=request("Content")
bname_err=0



if bname="" then
bname_err=1

end if


Dim regEx
Set regEx = New RegExp ' 建立正则表达式。 
regEx.Pattern = "^[A-Za-z0-9_]+$" ' 设置模式。 
regEx.IgnoreCase = False ' 设置是否区分大小写。 
retVal = regEx.Test(bname) ' 执行搜索测试。 







If retVal<>true Then 


bname_err=1



End If 


if bname_err=1 then

%>



<script language=javascript>
alert("标签名为空 或者 不是字母+数字及_号的组合");

history.go(-1);


</script>


<%





response.end 




else


bname1=bname













params_str=""

for iit=1 to cint(request("params_len"))

if trim(request("c"&cstr(iit)))<>"" then

sss1=replace(replace(trim(request("c"&cstr(iit))),",",""),"|","")
sss1=replace(replace(sss1,chr(34),"”"),"'","‘")

sss2=replace(replace(trim(request("s"&cstr(iit))),",", "," ),"|","")
sss2=replace(replace(sss2,chr(34),"”"),"'","‘")


'--------------v2
sss3=replace(replace(trim(request("g"&cstr(iit))),",", "," ),"|","")

params_str=params_str&sss1&","&sss2&","&sss3&"|"

'--------------v2

end if

next
if params_str<>"" then
params_str=left(params_str,len(params_str)-1) 

end if





par=split(params_str,"|")



'----h2---------
yooo=0
yooo2=0
for iiii=0 to ubound(par)
sss33=split(par(iiii),",")
sss3=sss33(0)

for iiiii=0 to ubound(par)

sss44=split(par(iiiii),",")
sss4=sss44(0)

if sss3=sss4 and cint(iiiii)<>cint(iiii) then
yooo=1
yooo2=1
end if
next

next




errhhhtd=0
htmledxa=cstr(replace_asp(request("htmledxa")))

htmledxb=""
for iit1=1 to cint(request("params_lenb"))

if trim(request("sc"&cstr(iit1)))<>"" and  trim(request("sd"&cstr(iit1)))<>""   then

sss1=request("sc"&cstr(iit1))
sss2=request("sd"&cstr(iit1))
if instr(1,sss1,"|",1)<>0 or  instr(1,sss1,":",1)<>0  or  instr(1,sss1,"'",1)<>0  or  instr(1,sss1,chr(34),1)<>0  or  instr(1,sss1,",",1)<>0 then
errhhhtd=1
yooo=1
exit for
end if
if instr(1,sss2,"|",1)<>0 or  instr(1,sss2,":",1)<>0 or  instr(1,sss2,"'",1)<>0  or  instr(1,sss2,chr(34),1)<>0  or  instr(1,sss2,",",1)<>0 then
errhhhtd=1
yooo=1
exit for
end if
htmledxb=htmledxb&sss1&"$123$121$accndcpu232$321$"&sss2&"$123$121$aspndcpu232$321$"
end if

next
if htmledxb<>"" then
htmledxb=left(htmledxb,len(htmledxb)-len("$123$121$aspndcpu232$321$")) 

end if
'----end h2---------









if yooo=1 then
'----h3---------
if yooo2=1 then
%>


<script language=javascript>

alert("发现参数列表中有同名参数,必须每个参数都不同名字!");

history.go(-1);
</script>


<%


response.end 

end if


if errhhhtd=1 then
%>


<script language=javascript>

alert("发现 本标签生成html静态页时的选项2 里填写的某个项的 开始asp代码的自定义开始标记 或 结束asp代码的自定义结束标记 里含以下的一个或多个不允许出现的字符:\n\n \" \' \, \: \| ");

history.go(-1);
</script>


<%


response.end 

end if
'----end h3---------


else




sql=replace_asp(request("sqlms"))
mode1=cstr(replace_asp(request("mode1")))

lbsm=replace_asp(trim(request("lbsm")))

fenyenum=replace_asp(request("fenye"))
iffen=replace_asp(request("iffen"))

di2xh_num=replace_asp(request("di2xh_num"))


rscname=trim(replace_asp(request("rsname")))










'loop_label_one_loop
run_asp_1_1=replace_asp(request("run_asp_1_1")) '每次循环前要执行的asp代码(可以为空)
ksdaima=replace_asp(request("ksdaima")) '每次循环的开始html代码输出(支持写入asp代码与标签)
Content111=request("Content")
jiesdaima=replace_asp(request("jiesdaima")) '每次循环的结束html代码输出(支持写入asp代码与标签):


'loop_label_two_loop
run_asp1=replace_asp(request("run_asp1"))'第一层循环(如行循环)的每次循环前要执行的asp代码
run_asp2=replace_asp(request("run_asp2"))'第二层循环(如列循环)的每次循环前要执行的asp代码(可以为空)
yi_ksdaima2=replace_asp(request("yi_ksdaima2"))'第一层循环(如行循环)的每次循环的开始html代码输出(支持写入asp代码与标签)
ksdaima2=replace_asp(request("ksdaima2"))'第二层循环(如列循环)的每次循环的开始html代码输出(支持写入asp代码与标签)
Content2=request("Content2")'循环体html代码输出(支持写入asp代码与标签)
jiesdaima2=replace_asp(request("jiesdaima2"))'第二层循环(如列循环)的每次循环的结束html代码输出(支持写入asp代码与标签):
yi_jiesdaima22=replace_asp(request("yi_jiesdaima22"))'第一层循环(如行循环)的每次循环的结束html代码输出(支持写入asp代码与标签)



hhks1=replace_asp(request("globa_qian_asp"))
hhend1=replace_asp(request("globa_end_asp"))


hhks2=replace_asp(request("globa_qian_asp2"))
hhend2=replace_asp(request("globa_end_asp2"))


sql_run=replace_asp(request("sql_run"))
sql_run2=replace_asp(request("sql_run2"))






if fenyenum="" then

%>



<script language=javascript>
alert("每页显示数量必填!");

history.go(-1);


</script>


<%


else




'if (di2xh_num="" or isnumeric(di2xh_num)=0 ) and  mode1="2" then
if (di2xh_num="") and  mode1="2" then
%>



<script language=javascript>
alert("第二层循环的循环次数 必填!");

history.go(-1);


</script>


<%


else
if trim(sql)="" then




%>



<script language=javascript>
alert("查询sql语句 不能为空!");

history.go(-1);


</script>


<%




else 


if mode1="1" then 

if trim(rscname)="" then rscname="rs_x2"


'asc(60)=<,asc(37)=%,chr(13)=enter,chr(62)=>


ext1=chr(60)&chr(37)&"'$start_ext_newDsoft 以下系统生成,勿删!"&vbcrlf&"'$newDsoft_label_type$:"&"loop_label_one_loop"&"$end_newDsoft_label_type$"&vbcrlf

ext1=ext1&"'$newDsoft_label_name$:"&bname1&"$end_newDsoft_label_name$"&vbcrlf




ext1=ext1&"'$newDsoft_label_sql$:"&sql&"$end_newDsoft_label_sql$"&vbcrlf

ext1=ext1&"'$newDsoft_label_params$:"&params_str&"$end_newDsoft_label_params$"&vbcrlf


ext1=ext1&"'$newDsoft_label_fenye_num$:"&fenyenum&"$end_newDsoft_label_fenye_num$"&vbcrlf

ext1=ext1&"'$newDsoft_label_beizhu$:"&lbsm&"$end_newDsoft_label_beizhu$"&vbcrlf

ext1=ext1&"'$newDsoft_is_sys_label$:"&"0"&"$end_newDsoft_is_sys_label$"&vbcrlf


ext1=ext1&"'$newDsoft_other_params$:"&"hhend:"&hhend1&"|hhks:"&hhks1&"|sql_run:"&sql_run&"|iffen:"&iffen&"|run_asp_1_1:"&run_asp_1_1&"|ksdaima:"&ksdaima&"|jiesdaima:"&jiesdaima&"|rsname:"&rscname&"|htmledxa:"&htmledxa&"|htmledxb:"&htmledxb&"$end_newDsoft_other_params$"&vbcrlf

ext1=ext1&"'$end_ext_newDsoft"&chr(37)&chr(62)&vbcrlf&vbcrlf&vbcrlf&vbcrlf




if filea.ReportFileStatus(server.mappath("../../Label/custom_Label/"&fpath&bname3))=1 then


%>



<script language=javascript>

alert("有重名标签文件存在!");

self.location="D_admin_custom_label.asp?fpath=<%=fpath%>";


</script>


<%

else

call createfile("../../Label/custom_Label/"&fpath&bname3,ext1&Content111,1)





'--------------------------add1

cont11=loadfile("../../Label/custom_Label/"&fpath&bname3)

call get_info_array_from_label_file_content(cont11)



set rs4aa=server.CreateObject("adodb.recordset")
       
rs4aa.open "select * from ND_label_cache where lcase(label_name)='"&nd1_l_name&"'",conn,1,1




set rs4=server.CreateObject("adodb.recordset")
    
if not rs4aa.eof then
	   
rs4.open "select * from ND_label_cache where lcase(label_name)='"&nd1_l_name&"'",conn,1,3   
else
	   
rs4.open "select * from ND_label_cache",conn,1,3


rs4.addnew

end if


rs4("label_code")=nd1_label_code
rs4("label_name")=nd1_l_name
rs4("label_full_path_name")=trim("Label/custom_Label/"&fpath&bname3)
rs4("label_params")=nd1_label_params
rs4("label_type")=nd1_label_type
rs4("label_sql")=nd1_label_sql
rs4("label_fenye_num")=nd1_label_fenye_num
rs4("label_beizhu")=nd1_label_beizhu
rs4("is_sys_label")="0"
rs4("label_other_params")=nd1_other_params


rs4.update

rs4.close

set rs4=nothing

'--------------------------add1



%>



<script language=javascript>

alert("添加成功!");

self.location="D_admin_custom_label.asp?fpath=<%=fpath%>";


</script>


<%
end if

else


if mode1="2" then 

if trim(rscname)="" then rscname="rs_x1"



'asc(60)=<,asc(37)=%,chr(13)=enter,chr(62)=>


ext1=chr(60)&chr(37)&"'$start_ext_newDsoft 以下系统生成,勿删!"&vbcrlf&"'$newDsoft_label_type$:"&"loop_label_two_loop"&"$end_newDsoft_label_type$"&vbcrlf

ext1=ext1&"'$newDsoft_label_name$:"&bname1&"$end_newDsoft_label_name$"&vbcrlf





ext1=ext1&"'$newDsoft_label_sql$:"&sql&"$end_newDsoft_label_sql$"&vbcrlf

ext1=ext1&"'$newDsoft_label_params$:"&params_str&"$end_newDsoft_label_params$"&vbcrlf


ext1=ext1&"'$newDsoft_label_fenye_num$:"&fenyenum&"$end_newDsoft_label_fenye_num$"&vbcrlf

ext1=ext1&"'$newDsoft_label_beizhu$:"&lbsm&"$end_newDsoft_label_beizhu$"&vbcrlf

ext1=ext1&"'$newDsoft_is_sys_label$:"&"0"&"$end_newDsoft_is_sys_label$"&vbcrlf


ext1=ext1&"'$newDsoft_other_params$:"&"hhend:"&hhend2&"|hhks:"&hhks2&"|sql_run:"&sql_run2&"|iffen:"&iffen&"|di2xh_num:"&di2xh_num&"|run_asp1:"&run_asp1&"|run_asp2:"&run_asp2&"|yi_ksdaima2:"&yi_ksdaima2&"|ksdaima2:"&ksdaima2&"|jiesdaima2:"&jiesdaima2&"|yi_jiesdaima22:"&yi_jiesdaima22&"|rsname:"&rscname&"|htmledxa:"&htmledxa&"|htmledxb:"&htmledxb&"$end_newDsoft_other_params$"&vbcrlf

ext1=ext1&"'$end_ext_newDsoft"&chr(37)&chr(62)&vbcrlf&vbcrlf&vbcrlf&vbcrlf



if filea.ReportFileStatus(server.mappath("../../Label/custom_Label/"&fpath&bname3))=1 then

%>



<script language=javascript>

alert("有重名标签文件存在!");

self.location="D_admin_custom_label.asp?fpath=<%=fpath%>";


</script>


<%

else

call createfile("../../Label/custom_Label/"&fpath&bname3,ext1&Content2,1)








'--------------------------add1

cont11=loadfile("../../Label/custom_Label/"&fpath&bname3)

call get_info_array_from_label_file_content(cont11)



set rs4aa=server.CreateObject("adodb.recordset")
       
rs4aa.open "select * from ND_label_cache where lcase(label_name)='"&nd1_l_name&"'",conn,1,1




set rs4=server.CreateObject("adodb.recordset")
    
if not rs4aa.eof then
	   
rs4.open "select * from ND_label_cache where lcase(label_name)='"&nd1_l_name&"'",conn,1,3   
else
	   
rs4.open "select * from ND_label_cache",conn,1,3


rs4.addnew

end if


rs4("label_code")=nd1_label_code
rs4("label_name")=nd1_l_name
rs4("label_full_path_name")=trim("Label/custom_Label/"&fpath&bname3)
rs4("label_params")=nd1_label_params
rs4("label_type")=nd1_label_type
rs4("label_sql")=nd1_label_sql
rs4("label_fenye_num")=nd1_label_fenye_num
rs4("label_beizhu")=nd1_label_beizhu
rs4("is_sys_label")="0"
rs4("label_other_params")=nd1_other_params


rs4.update

rs4.close

set rs4=nothing

'--------------------------add1





%>



<script language=javascript>

alert("添加成功!");

self.location="D_admin_custom_label.asp?fpath=<%=fpath%>";


</script>


<%


end if

else





%>



<script language=javascript>
alert("暂时不支持大于2层的循环!");

history.go(-1);


</script>


<%



end if


end if





end if
end if

end if

end if

end if
%>

<%
AJAXcloseLoader()
%>

</html>